<template>
  <avue-crud :option="option"
             :data="data"></avue-crud>
</template>
<script>
let baseUrl = 'https://cli.avuejs.com/api/area'
export default {
  data () {
    return {
      data: [{
        name: '张三',
        sex: '男',
        age: 18,
        province: '110000'
      }, {
        name: '李四',
        sex: '女',
        age: 18,
        province: '130000'
      }],
      option: {
        grid: true,
        gridSpan: 12,
        // gridBackgroundColor:'linear-gradient(to right, rgba(255,0,0,0.2), rgba(255,0,0,0.2))',
        gridBackgroundImage: '/images/grid.png',
        column: [
          {
            label: '姓名',
            prop: 'name',
          }, {
            label: '性别',
            prop: 'sex',
            gridRow: true
          }, {
            label: '年龄',
            prop: 'age',
          }, {
            label: '省份',
            prop: 'province',
            type: 'select',
            props: {
              label: 'name',
              value: 'code'
            },
            dicUrl: `${baseUrl}/getProvince`
          }
        ]
      }
    }
  }
}
</script>